<template>
	<view class="wrapForm">
		<view class="bgLine"></view>
		<view class="wrapFormBody pL15 pR15 pT15">
			<view class="bold font20 mB15">
				注销账号须知
			</view>
			<u-parse :html="info?.content"></u-parse>
		</view>
		<view class="flex jst-center bottomW">
			<view class="pointer rightNowPay u-f font15 t-center" @click="destroyAccount">
				注销账号
			</view>
		</view>
		<xfTipModal ref="tipModal"></xfTipModal>
	</view>
</template>

<script>
	import {getXy} from "@/api/userInterface/user.js"
	import {destroyAccount} from "@/api/common.js"
	export default {
		data() {
			return {
				info:{}
			}
		},
		onLoad(e) {
			this.getXyOpt(e.type)
		},
		methods: {
			destroyAccount(){
				let that=this;
				this.$refs.tipModal.open({
					content: "账户注销后将无法登录确认注销账号吗？",
					btnText: "确定",
					showCancel: true,
					success: function() {
						destroyAccount().then(res=>{
							if(res.success==true){
								that.xf.onlineUtils.toast('注销成功！')
								setTimeout(()=>{
									// #ifdef MP-USER
										uni.switchTab({
											url:"/pages/userPage/home/index"
										})
									// #endif
									// #ifndef MP-COMPANY 
										uni.redirectTo({
											url:"/pages/login/login"
										})
									// #endif
									// #ifndef MP-ECONOMIC
										uni.redirectTo({
											url:"/pages/login/login"
										})
									// #endif
								},2000)
							}
						})
						
						
					}
				})
			},
			getXyOpt(v){
				getXy({agreement:v}).then(res=>{
					if(res.code==200){
						this.info=res.result
						console.log(this.info,'indo');
						
					}
				})
			}
		}
	}
</script>
<style lang="scss">
	page {
		
		/* #ifdef MP-WEIXIN */
		  height: 100%;
		/* #endif */
		background-color: #fff;
	}
</style>
<style lang="scss" scoped>
	.wrapForm{
		height: 100%;
		.wrapFormBody{
			margin-top: -30rpx;
			border-radius: 40rpx 40rpx 0 0;
			background: #fff;
			padding-bottom: 160rpx;
		}
	}
	.bgLine{
		/* #ifdef MP-USER */
		background-color: #E1EEFF;
		/* #endif */
		/* #ifdef MP-COMPANY */
		background-color: #EBF0FF;
		/* #endif */
		/* #ifdef MP-ECONOMIC */
		background-color: #EBFCFF;
		/* #endif */
		width: 100%;
		height: 60rpx;
	}
	.rightNowPay {
		width: 670rpx;
		height: 100rpx;
		line-height: 100rpx;
		background: #EB392F;
		border-radius: 30rpx;
	
	}
</style>
